import java.util.Scanner;

public class note5 {

//1.输出一个整数的每一位，如：123的每一位是3，2，1
/*    public static void main1(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        scan.close();
        int t=0;
        if(n<0){
            n=-n;
        }
        while(n>0){
            t=n%10;
            n=n/10;
            System.out.print(t+",");
        }
    }*/


//写代码模拟三次密码输入的场景。 最多能输入三次密码，密码正确，
// 提示“登录成功”,密码错误， 可以重新输 入，最多输入三次。三次均错，则提示退出程序
/*
    public static void main2(String[] args) {
        int password=2341;
        int guess=0;
        Scanner scan=new Scanner(System.in);
        int t=3;
        while(t!=0){
            guess=scan.nextInt();
            if(guess==password) {
                System.out.println("登陆成功");
                return;
            }
            t--;
            System.out.println("密码错误，还有"+t+"次机会");
        }
        System.out.println("退出程序");
*/


    //3.求1！+2！+3！+4！+........+n!的和
    public static void main3(String[] args) {
        int n = 0;
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        int i = 0;
        int j = 0;

        int sum = 0;
        for (i = 1; i <= n; i++) {
            int factorial = 1;
            for (j = 1; j <= i; j++) {
                factorial *= j;
            }
            sum += factorial;
        }
        System.out.println(sum);
    }


    //4.求斐波那契数列的第n项。(迭代实现)
    public static void main4(String[] args) {
        int a = 0;
        int b = 1;
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int temp = 0;
        int i = 0;
        if (n == 1) {
            System.out.println("数列的第1项是：" + a);
        } else if (n == 2) {
            System.out.println("数列的第2项是：" + b);
        } else {
            for (i = 2; i < n; i++) {
                temp = a + b;
                a = b;
                b = temp;
            }
            System.out.println("数列的第" + n + "项是：" + temp);
        }
    }


    //在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值.
    public static void main(String[] args) {
        System.out.println(max(1,4.0,2.6));
    }
    public static int max(int x,int y){
        return x>y?x:y;
    }
    public static double max(double x,double y,double z){
        double temp=x>y?x:y;
        return temp>z?temp:z;
    }
}